/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: CallAuthentication.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/15 下午4:59
 * LastModified: 2020/03/15 16:59:15
 */

package com.qolome.knowledge.design.pattern.strategy.demo.authentication;


import com.qolome.utils.web.HttpResult;
import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;

/**
 * @author Qolome
 * @version V1.0
 * @Description 认证
 * @date 2020年 03月15日 16:59:40
 */
@Slf4j
public class CallAuthentication {

    private String uid;
    private String accessToken;


    public CallAuthentication(String uid, String accessToken) {
        this.uid = uid;
        this.accessToken = accessToken;
    }


    public HttpResult authentication() {
        return authentication(AuthenticationType.DEFAULT);

    }

    public HttpResult authentication(String payKey) {

        AbstractAuthentication abstractPayment = AuthenticationType.get(payKey);
        log.info("您的认证名称为:{}",abstractPayment.getAuthenticationType());
        return  abstractPayment.authentication(uid,accessToken);
    }

}
